<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Repositories\UserRepo;

class UserController extends BaseController
{
    protected $userRepo;

    public function _initialize()
    {
        $this->userRepo = new UserRepo();
    }
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        //
        $where = [];
        $data = $this->userRepo->getUserList($where);
        return $this->sucRes(200,$data);
    }

  

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request)
    {
        //
        $id = $request->id;

        $input = $request->only(['state','mark']);

        $this->userRepo->updateUser($id,$input);

        return $this->sucRes();
    }
}